<template>
    <div class="flex-main">
        <div class="flex-body">
            <menu-tabs :menutab="menutab" class="mb" @setMenutab='setMenutab'></menu-tabs>
            <no-data v-if="videoList.length<1"></no-data>
            <div class="m-list" v-else>
                <div v-for="(item,index) in videoList" :key="index">
                    <img :src="item.path" alt="" v-if="item.store==1">
                    <video :src="item.path" :poster="item.coverimg" v-else></video>
                    <p>{{item.videoname}}</p>
                </div>
                
            </div>
        </div>
        
    </div>
</template>
<script>
import {friendsCircle} from '@/api/views';
export default {
    name:'',
    data () {
        return {
            menutab:['语音课程','视频','图片'],
            type:0,
            pageNo:1,
            videoList:[],       //列表数据
            base_url:process.env.API_HOST,
        }
    },
    components: {
        menuTabs:()=>import('@/components/menuTabs'),
    },
    methods: {
        // 选择menu
        setMenutab(index) {
            this.type = index;
        },
        // 获取列表数据
        getFriendscircle() {
            let that = this;
            this.$indicator.open('加载中...');
            let param = {
                page:that.pageNo,
                list_rows:10,
                type:that.type,
            }
            friendsCircle(param).then((result) => {
                that.videoList = result.list.data;
                this.$indicator.close();
            }).catch((err) => {
                this.$indicator.close();
            });
        }
    },
    mounted() {
        this.getFriendscircle();
    }
}
</script>
<style lang="less" scoped src="@/less/friendCircle/friendCircle.less"></style>
